﻿using System;
using Ant.Interface.Mef;

namespace Ant.Interface.Data.Migration.Schema
{
    public interface ISchemaBuilder : IAutoDependency
    {
        ISchemaBuilder CreateTable(string name, Action<CreateTableCommand> table);

        ISchemaBuilder AlterTable(string name, Action<AlterTableCommand> table);

        ISchemaBuilder DropTable(string name);

        ISchemaBuilder ExecuteSql(string sql, Action<SqlStatementCommand> statement = null);

        ISchemaBuilder CreateForeignKey(string name, string srcTable, string[] srcColumns, string destTable, string[] destColumns);

        ISchemaBuilder CreateForeignKey(string name, string srcModule, string srcTable, string[] srcColumns, string destTable, string[] destColumns);

        ISchemaBuilder CreateForeignKey(string name, string srcTable, string[] srcColumns, string destModule, string destTable, string[] destColumns);

        ISchemaBuilder CreateForeignKey(string name, string srcModule, string srcTable, string[] srcColumns, string destModule, string destTable, string[] destColumns);

        ISchemaBuilder DropForeignKey(string srcTable, string name);

        ISchemaBuilder DropForeignKey(string srcModule, string srcTable, string name);
    }
}